home *** CD-ROM | disk | FTP | other *** search
/ PC Answers 1995 May / PC Answers CD-ROM 7 (Future Publishing) (May 1995).iso / vbits / code / lang / intro / smile.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  1994-10-06  |  1.8 KB  |  79 lines

  1. // smile.cpp : Implementation of CSmileApp and DLL registration.
  2.  
  3. #include "stdafx.h"
  4. #include "smile.h"
  5.  
  6. #ifdef _DEBUG
  7. #undef THIS_FILE
  8. static char BASED_CODE THIS_FILE[] = __FILE__;
  9. #endif
  10.  
  11.  
  12. CSmileApp NEAR theApp;
  13.  
  14. const GUID CDECL BASED_CODE _tlid =
  15.         { 0xedec4488, 0xc101, 0x101b, { 0xac, 0x9d, 0x0, 0xaa, 0x0, 0x47, 0xd4, 0xfd } };
  16. const WORD _wVerMajor = 1;
  17. const WORD _wVerMinor = 0;
  18.  
  19.  
  20. ////////////////////////////////////////////////////////////////////////////
  21. // CSmileApp::InitInstance - DLL initialization
  22.  
  23. BOOL CSmileApp::InitInstance()
  24. {
  25.     BOOL bInit = COleControlModule::InitInstance();
  26.  
  27.     if (bInit)
  28.     {
  29.         // TODO: Add your own module initialization code here.
  30.     }
  31.  
  32.     return bInit;
  33. }
  34.  
  35.  
  36. ////////////////////////////////////////////////////////////////////////////
  37. // CSmileApp::ExitInstance - DLL termination
  38.  
  39. int CSmileApp::ExitInstance()
  40. {
  41.     // TODO: Add your own module termination code here.
  42.  
  43.     return COleControlModule::ExitInstance();
  44. }
  45.  
  46.  
  47. /////////////////////////////////////////////////////////////////////////////
  48. // DllRegisterServer - Adds entries to the system registry
  49.  
  50. STDAPI DllRegisterServer(void)
  51. {
  52.     AFX_MANAGE_STATE(_afxModuleAddrThis);
  53.  
  54.     if (!AfxOleRegisterTypeLib(AfxGetInstanceHandle(), _tlid))
  55.         return ResultFromScode(SELFREG_E_TYPELIB);
  56.  
  57.     if (!COleObjectFactoryEx::UpdateRegistryAll(TRUE))
  58.         return ResultFromScode(SELFREG_E_CLASS);
  59.  
  60.     return NOERROR;
  61. }
  62.  
  63.  
  64. /////////////////////////////////////////////////////////////////////////////
  65. // DllUnregisterServer - Removes entries from the system registry
  66.  
  67. STDAPI DllUnregisterServer(void)
  68. {
  69.     AFX_MANAGE_STATE(_afxModuleAddrThis);
  70.  
  71.     if (!AfxOleUnregisterTypeLib(_tlid))
  72.         return ResultFromScode(SELFREG_E_TYPELIB);
  73.  
  74.     if (!COleObjectFactoryEx::UpdateRegistryAll(FALSE))
  75.         return ResultFromScode(SELFREG_E_CLASS);
  76.  
  77.     return NOERROR;
  78. }
  79.